<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Reserved keywords | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'sql-syntax-reserved.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/sql-syntax-reserved.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/sql-syntax-reserved.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/sql-syntax-reserved.html" rel="nofollow" target="_blank">../en/sql-syntax-reserved.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="xpack-sql.html">SQL access</a></span>
»
<span class="breadcrumb-node">Reserved keywords</span>
</div>
<div class="navheader">
<span class="prev">
<a href="sql-functions-system.html">« System Functions</a>
</span>
<span class="next">
<a href="sql-limitations.html">SQL Limitations »</a>
</span>
</div>
<div class="chapter xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="sql-syntax-reserved"></a>Reserved keywords<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/sql/appendix/syntax-reserved.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>
<p>Table with reserved keywords that need to be quoted. Also provide an example to make it more obvious.</p>
<p>The following table lists all of the keywords that are reserved in Elasticsearch SQL,
along with their status in the SQL standard. These reserved keywords must
be quoted (using double quotes) in order to be used as an identifier, for example:</p>
<div class="pre_wrapper lang-sql">
<pre class="programlisting prettyprint lang-sql">SELECT "AS" FROM index</pre>
</div>
<div class="informaltable">
<table border="1" cellpadding="4px">
<colgroup>
<col class="col_1">
<col class="col_2">
<col class="col_3">
</colgroup>
<tbody>
<tr>
<td align="center" valign="top"><p><span class="strong strong"><strong>Keyword</strong></span></p></td>
<td align="center" valign="top"><p><span class="strong strong"><strong>SQL:2016</strong></span></p></td>
<td align="center" valign="top"><p><span class="strong strong"><strong>SQL-92</strong></span></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ALL</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">AND</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ANY</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">AS</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ASC</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">BETWEEN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">BY</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CAST</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CATALOG</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CONVERT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CURRENT_DATE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CURRENT_TIMESTAMP</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">CURRENT_TIME</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">DAY</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">DAYS</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">DESC</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">DESCRIBE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">DISTINCT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ESCAPE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">EXISTS</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">EXPLAIN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">EXTRACT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">FALSE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">FIRST</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">FROM</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">FULL</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">GROUP</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">HAVING</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">HOUR</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">HOURS</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">IN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">INNER</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">INTERVAL</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">IS</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">JOIN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">LEFT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">LIKE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">LIMIT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">MATCH</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">MINUTE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">MINUTES</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">MONTH</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">NATURAL</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">NOT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">NULL</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">NULLS</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ON</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">OR</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">ORDER</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">OUTER</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">RIGHT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">RLIKE</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">QUERY</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">SECOND</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">SECONDS</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">SELECT</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">SESSION</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">TABLE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">TABLES</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">THEN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">TO</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">TRUE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">TYPE</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">USING</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">WHEN</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">WHERE</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">WITH</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">YEAR</code></p></td>
<td align="center" valign="top"><p>reserved</p></td>
<td align="center" valign="top"><p>reserved</p></td>
</tr>
<tr>
<td align="center" valign="top"><p><code class="literal">YEARS</code></p></td>
<td align="center" valign="top"><p></p></td>
<td align="center" valign="top"><p></p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="navfooter">
<span class="prev">
<a href="sql-functions-system.html">« System Functions</a>
</span>
<span class="next">
<a href="sql-limitations.html">SQL Limitations »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>